package descentFly.app
{
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;
	
	import descentFly.app.social.ISocial;
	import descentFly.df_space;
	import descentFly.df_utils;
	
	import flash.geom.Rectangle;
	
	public class df_component extends uif_ecomponent {
		public static const SCROLLBAR_WIDTH: int = 20;
		protected var _componentLayer: df_component; 
		public function df_component(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, styleClass:Object='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
			_componentLayer = createComponentLayer(getInner());
			createComponents(_componentLayer, _componentLayer.getInner());
		}
		
		protected function createComponents(layer: df_component, inner: Rectangle): void {
			
		}
		
		protected function createComponentLayer(inner: Rectangle): df_component {
			return this;
		}
		
		public function get locale(): Object {
			return df_locale;
		}
		
		public function get dfApp(): df_baseApp {
			return app as df_baseApp;
		}
		
		public function get Space(): df_space {
			return (dfApp)?dfApp.space:null;
		}
		
		public function get social(): ISocial {
			return dfApp.social;
		}
		
		public function callWaitEvent(event: String, func: Function): void {
			df_utils.callWaitEvent(this, event, func);
		}
		
		public function callWaitEvent2(noWait: Boolean, event: String, func: Function): void {
			df_utils.callWaitEvent2(this, noWait, event, func);
		}		
	}
}